package com.resou.reader.api.entry;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by ${Garrett} on 2018/9/17.
 * Contact me krouky@outlook.com
 */
public class RankTypeBean implements Parcelable {
    private int rankType;
    private String rankName;

    private boolean isCheck = false;

    public RankTypeBean() {
    }

    protected RankTypeBean(Parcel in) {
        rankType = in.readInt();
        rankName = in.readString();
        isCheck = in.readByte() != 0;
    }

    public static final Creator<RankTypeBean> CREATOR = new Creator<RankTypeBean>() {
        @Override
        public RankTypeBean createFromParcel(Parcel in) {
            return new RankTypeBean(in);
        }

        @Override
        public RankTypeBean[] newArray(int size) {
            return new RankTypeBean[size];
        }
    };

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    public RankTypeBean(int rankType, String rankName) {
        this.rankType = rankType;
        this.rankName = rankName;
    }

    public int getRankType() {
        return rankType;
    }

    public void setRankType(int rankType) {
        this.rankType = rankType;
    }

    public String getRankName() {
        return rankName;
    }

    public void setRankName(String rankName) {
        this.rankName = rankName;
    }


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(rankType);
        dest.writeString(rankName);
        dest.writeByte((byte) (isCheck ? 1 : 0));
    }
}
